﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Configuration;

namespace YBApproval.BLL
{
    public class DALFactory
    {
        private static string dalPath = ConfigurationManager.AppSettings["DAL"];

        public static T GetDAL<T>()
        {
            string className = typeof(T).Name.Substring(1);
            string fullPath = dalPath + "." + className + "DAL";
            return (T)Assembly.Load(dalPath).CreateInstance(fullPath);
        }
    }
}
